<!--
 * @Author: LiuHaiL 18655112670@139.com
 * @Date: 2023-07-14 09:08:52
 * @LastEditors: LiuHaiL 18655112670@139.com
 * @LastEditTime: 2023-07-14 09:13:04
 * @FilePath: \general-admin\src\components\table\column\index.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<script lang="ts">
import { defineComponent, createVNode, reactive } from 'vue'
import { ElTableColumn } from 'element-plus'
import { uuid } from '../../../utils/random'
export default defineComponent({
    name: 'Column',
    props: {
        attr: {
            type: Object,
            required: true,
        },
    },
    setup(props, { slots }) {
        const attr = reactive(props.attr)
        attr['column-key'] = attr['column-key'] ? attr['column-key'] : attr.prop || uuid()
        return () => {
            return createVNode(ElTableColumn, attr, slots.default)
        }
    },
})
</script>
